package com.community.backend.mapper;

import cn.hutool.system.UserInfo;
import com.community.backend.annotation.AutoFill;
import com.community.backend.enumeration.OperationType;
import com.community.backend.pojo.Property;
import com.community.backend.pojo.Security;
import com.community.backend.pojo.dto.PropertyQueryDTO;
import com.community.backend.pojo.dto.RegisterDTO;
import com.community.backend.pojo.vo.PropertyQueryVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.Map;

@Mapper
public interface PropertyMapper {
    Page<PropertyQueryVO> pageQuery(PropertyQueryDTO propertyQueryDTO);
@AutoFill(value = OperationType.INSERT)
    Integer add(Property property);
@AutoFill(value = OperationType.UPDATE)
    Integer update(Property property);

    void register(RegisterDTO registerDTO);

    Property login(String username, String password);
@AutoFill(value = OperationType.UPDATE)
    Integer updateById(Property property);

    BigDecimal paidSumByMap(Map map);
    @Select("select count(*) from propertyfee where status = #{status} and isDelete = '未删除'")
    Integer selectAllByStatus(String status);
}
